import request from '@/utils/request'

// ========================= 管理 ======================================
// Get Record
export const QueryShouquan = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/shouquan/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// 流程通过或拒绝
export const FlowApplyRecord = (data) => {
  return request({
    headers: { 'Content-Type': 'multipart/form-data'},
    url: '/v1/prse/shouquan/manage/',
    method: 'post',
    data,
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Record
export const CreateShouquanRecord = (data) => {
  return request({
    headers: { 'Content-Type': 'multipart/form-data'},
    url: '/v1/prse/shouquan/my/',
    method: 'post',
    data,
  })
}

// Query My Record
export const QueryShouquanRecord = (page, pageSize) => {
  return request({
    url: '/v1/prse/shouquan/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Record
export const EvaluateMyRecord = (data) => {
  return request({
    url: '/v1/prse/shouquan/myEvaluate/',
    method: 'post',
    data,
  })
}

// ============================== 工作者 =========================
// Get Record
export const QueryShouquanToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/shouquan/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}


// ============================== 通用 =========================
// Preview My Hedging File
export const GetMyRecordPreviewImages = (rid,note) => {
  return request({
    url: '/v1/prse/shouquan/my/dataPreView/',
    method: 'get',
    params: { rid,note },
  })
}

